package com.haiyou.sdk.rank;

import com.haiyou.common.util.time.TimeUtil;
import com.haiyou.sdk.constants.LiyuConstants;

import lombok.extern.slf4j.Slf4j;

/**
 * 积分榜单
 * 
 * @author hong
 * @date 2024年2月24日 下午3:09:06
 */
@Slf4j
public class RankScoreRank extends AbstractServerRank<Long, RankScoreEntity> {

	public static final String keyPrefix = LiyuConstants.rank;

	public RankScoreRank(int areaId, String dbType) {
		super(areaId, dbType, keyPrefix + "-" + TimeUtil.todayZero());
	}

	@Override
	public double calScoredByV(RankScoreEntity v) {
		return v.getAddtion();
	}

	@Override
	public int getRankType() {
		return LiyuConstants.RANK_TYPE_1;
	}

	public static RankScoreRank build(int areaId, String dbType) {
		RankScoreRank rank = new RankScoreRank(areaId, dbType);
		return rank;
	}

	@Override
	public Long getId(RankScoreEntity v) {
		return v.getId();
	}

}
